package voidgame.core;
import java.io.File;
import java.util.Random;

public class Moon extends CelestialObject{
	
	Planet planet;
	String name;
	int size;
	final String[] SIZE = {"small", "average sized", "large"};
	int dist;
	
	String desc;
	
	
	public Moon(String n, int d, Planet p){
		final String[] greekext ={"Alpha","Beta","Gamma","Delta","Epsilon","Zeta","Eta","Theta","Iota","Kappa","Lambda","Mu","Nu","Xi","Omicron","Pi","Rho","Sigma","Tau","Upsilon","Phi","Chi","Psi","Omega","Sho","Heta","Stigma","San","Sampi","Qoppa","Digamma","Aleph","Beth","Gimel","Daleth","He", "Zayin", "Heth", "Teth","Yodh","Kaph"};
		
		planet = p;
		dist=d;
		
		pos = new int[2];
		
		if(n.equals(p.name))
			name = n+" "+greekext[p.moons.size()];
		else
			name=n;
		
		size = new Random().nextInt(3);
		
		
		String[] potSprite = new File(".//images//celestial//moon//").list();
		String tempSprite = potSprite[new Random().nextInt(potSprite.length)];
		while(!tempSprite.substring(tempSprite.length()-3).equals("png")&&!tempSprite.substring(tempSprite.length()-3).equals("jpg")){
			//System.out.println("FAIL7 "+tempSprite+" "+tempSprite.substring(tempSprite.length()-3));
			tempSprite = potSprite[new Random().nextInt(potSprite.length)];
		}
		sprite=".//images//celestial//moon//"+tempSprite;
		
		switch(size){
		case 0: spriteSize=0.3;break;
		case 1: spriteSize=0.35;break;
		case 2: spriteSize=0.4;break;
		}
		
		genDesc();
		
	}
	
	public void genDesc(){
		desc = SIZE[size] +" moon "+" that orbits in position "+dist+" around "+planet.name+".";
		
	}
	
}